<?php
/**
 * Created by PhpStorm.
 * User: zmit
 * Date: 8/9/17
 * Time: 2:12 PM
 */
namespace AdminBundle\Controller;

use ApiBundle\Controller\BaseController;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class AdminController extends BaseController
{
    protected $this_admin_id;
    protected $this_admin_name;
    protected $this_admin_role_id;
    protected $this_district_id;

    public function isPageLogined()
    {
        if(!$this->get("session")->get("admin_id")){

            return false;
        }

        $this->this_admin_id = $this->get("session")->get("admin_id");
        $this->this_admin_name = $this->get("session")->get("admin_name");
        $this->this_admin_role_id = $this->get("session")->get("admin_role_id");
        $this->this_district_id = $this->get("session")->get("district_id");

        $this->get("session")->set("admin_id",$this->this_admin_id);
        $this->get("session")->set("admin_name",$this->this_admin_name);
        $this->get("session")->set("admin_role_id",$this->this_admin_role_id);
        $this->get("session")->set("district_id",$this->this_district_id);

        return true;
    }
}